import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
  Req,
  HttpException,
  HttpStatus,
} from '@nestjs/common';
import { AnalyticsService } from './analytics.service';
import { CreateAnalyticsDto } from './dto/analytics.dto';
import { ApiTags } from '@nestjs/swagger';

@ApiTags('小程序/事件')
@Controller('app/analytics')
export class AnalyticsController {
  constructor(private readonly analyticsService: AnalyticsService) {}

  /**
   * 创建事件
   */
  @Post()
  async create(@Req() req: Request, @Body() data: CreateAnalyticsDto) {
    await this.analyticsService.create(req.user, data.eventType);
  }
}
